package com.ChenYaRou.www.dao;


import com.ChenYaRou.www.po.Food;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 86183
 */
public interface FoodDao {
    /**
     * 新建美食
     * @param food 新美食
     * @return 更新条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int insert(Food food) throws IllegalAccessException, SQLException ;

    /**
     * 更新food
     * @param newFood 新赋值内容
     * @param oldFood 更新的food
     * @return 更新条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int update(Food newFood,Food oldFood) throws IllegalAccessException, SQLException ;

    /**
     * 查找food集合
     * @param food 条件food
     * @return
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    List<Food> selectMore(Food food) throws IllegalAccessException,
            SQLException, NoSuchFieldException, InstantiationException ;

    /**
     * 模糊搜索foodName
     * @param food 含有模糊关键字的name的food
     * @return food集合
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    List<Food> fuzzySelect(Food food) throws IllegalAccessException, SQLException,
            NoSuchFieldException, InstantiationException ;

        /**
         * 删除菜单
         */
    void delete();

    /**
     * 查找所有food集合
     * @param food 条件food
     * @return
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    List<Food> selectAll(Food food) throws IllegalAccessException, SQLException,
            NoSuchFieldException, InstantiationException;


}
